//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS CodeStarConnections service.
///
/// AWS CodeStar Connections This Amazon Web Services CodeStar Connections API Reference provides descriptions and usage examples of the operations and data types for the Amazon Web Services CodeStar Connections API. You can use the connections API to work with connections and installations.  Connections are configurations that you use to connect Amazon Web Services resources to external code repositories. Each connection is a resource that can be given to services such as CodePipeline to connect to a third-party repository such as Bitbucket. For example, you can add the connection in CodePipeline so that it triggers your pipeline when a code change is made to your third-party code repository. Each connection is named and associated with a unique ARN that is used to reference the connection. When you create a connection, the console initiates a third-party connection handshake. Installations are the apps that are used to conduct this handshake. For example, the installation for the Bitbucket provider type is the Bitbucket app. When you create a connection, you can choose an existing installation or create one. When you want to create a connection to an installed provider type such as GitHub Enterprise Server, you create a host for your connections. You can work with connections by calling:    CreateConnection, which creates a uniquely named connection that can be referenced by services such as CodePipeline.    DeleteConnection, which deletes the specified connection.    GetConnection, which returns information about the connection, including the connection status.    ListConnections, which lists the connections associated with your account.   You can work with hosts by calling:    CreateHost, which creates a host that represents the infrastructure where your provider is installed.    DeleteHost, which deletes the specified host.    GetHost, which returns information about the host, including the setup status.    ListHosts, which lists the hosts associated with your account.   You can work with tags in Amazon Web Services CodeStar Connections by calling the following:    ListTagsForResource, which gets information about Amazon Web Services tags for a specified Amazon Resource Name (ARN) in Amazon Web Services CodeStar Connections.    TagResource, which adds or updates tags for a resource in Amazon Web Services CodeStar Connections.    UntagResource, which removes tags for a resource in Amazon Web Services CodeStar Connections.   For information about how to use Amazon Web Services CodeStar Connections, see the Developer Tools User Guide.
public struct CodeStarConnections: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the CodeStarConnections client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "CodeStar_connections_20191201",
            serviceName: "CodeStarConnections",
            serviceIdentifier: "codestar-connections",
            serviceProtocol: .json(version: "1.0"),
            apiVersion: "2019-12-01",
            endpoint: endpoint,
            errorType: CodeStarConnectionsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.
    @Sendable
    @inlinable
    public func createConnection(_ input: CreateConnectionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateConnectionOutput {
        try await self.client.execute(
            operation: "CreateConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.
    ///
    /// Parameters:
    ///   - connectionName: The name of the connection to be created.
    ///   - hostArn: The Amazon Resource Name (ARN) of the host associated with the connection to be created.
    ///   - providerType: The name of the external provider where your third-party code repository is configured.
    ///   - tags: The key-value pair to use when tagging the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func createConnection(
        connectionName: String,
        hostArn: String? = nil,
        providerType: ProviderType? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateConnectionOutput {
        let input = CreateConnectionInput(
            connectionName: connectionName, 
            hostArn: hostArn, 
            providerType: providerType, 
            tags: tags
        )
        return try await self.createConnection(input, logger: logger)
    }

    /// Creates a resource that represents the infrastructure where a third-party provider is installed. The host is used when you create connections to an installed third-party provider type, such as GitHub Enterprise Server. You create one host for all connections to that provider.  A host created through the CLI or the SDK is in `PENDING` status by default. You can make its status `AVAILABLE` by setting up the host in the console.
    @Sendable
    @inlinable
    public func createHost(_ input: CreateHostInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateHostOutput {
        try await self.client.execute(
            operation: "CreateHost", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a resource that represents the infrastructure where a third-party provider is installed. The host is used when you create connections to an installed third-party provider type, such as GitHub Enterprise Server. You create one host for all connections to that provider.  A host created through the CLI or the SDK is in `PENDING` status by default. You can make its status `AVAILABLE` by setting up the host in the console.
    ///
    /// Parameters:
    ///   - name: The name of the host to be created.
    ///   - providerEndpoint: The endpoint of the infrastructure to be represented by the host after it is created.
    ///   - providerType: The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.
    ///   - tags: Tags for the host to be created.
    ///   - vpcConfiguration: The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.
    ///   - logger: Logger use during operation
    @inlinable
    public func createHost(
        name: String,
        providerEndpoint: String,
        providerType: ProviderType,
        tags: [Tag]? = nil,
        vpcConfiguration: VpcConfiguration? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateHostOutput {
        let input = CreateHostInput(
            name: name, 
            providerEndpoint: providerEndpoint, 
            providerType: providerType, 
            tags: tags, 
            vpcConfiguration: vpcConfiguration
        )
        return try await self.createHost(input, logger: logger)
    }

    /// Creates a link to a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.
    @Sendable
    @inlinable
    public func createRepositoryLink(_ input: CreateRepositoryLinkInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateRepositoryLinkOutput {
        try await self.client.execute(
            operation: "CreateRepositoryLink", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a link to a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.
    ///
    /// Parameters:
    ///   - connectionArn: The Amazon Resource Name (ARN) of the connection to be associated with the repository link.
    ///   - encryptionKeyArn: The Amazon Resource Name (ARN) encryption key for the repository to be associated with the repository link.
    ///   - ownerId: The owner ID for the repository associated with a specific sync configuration, such as the owner ID in GitHub.
    ///   - repositoryName: The name of the repository to be associated with the repository link.
    ///   - tags: The tags for the repository to be associated with the repository link.
    ///   - logger: Logger use during operation
    @inlinable
    public func createRepositoryLink(
        connectionArn: String,
        encryptionKeyArn: String? = nil,
        ownerId: String,
        repositoryName: String,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateRepositoryLinkOutput {
        let input = CreateRepositoryLinkInput(
            connectionArn: connectionArn, 
            encryptionKeyArn: encryptionKeyArn, 
            ownerId: ownerId, 
            repositoryName: repositoryName, 
            tags: tags
        )
        return try await self.createRepositoryLink(input, logger: logger)
    }

    /// Creates a sync configuration which allows Amazon Web Services to sync content from a Git repository to update a specified Amazon Web Services resource. Parameters for the sync configuration are determined by the sync type.
    @Sendable
    @inlinable
    public func createSyncConfiguration(_ input: CreateSyncConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateSyncConfigurationOutput {
        try await self.client.execute(
            operation: "CreateSyncConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a sync configuration which allows Amazon Web Services to sync content from a Git repository to update a specified Amazon Web Services resource. Parameters for the sync configuration are determined by the sync type.
    ///
    /// Parameters:
    ///   - branch: The branch in the repository from which changes will be synced.
    ///   - configFile: The file name of the configuration file that manages syncing between the connection and the repository. This configuration file is stored in the repository.
    ///   - publishDeploymentStatus: Whether to enable or disable publishing of deployment status to source providers.
    ///   - repositoryLinkId: The ID of the repository link created for the connection. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.
    ///   - resourceName: The name of the Amazon Web Services resource (for example, a CloudFormation stack in the case of CFN_STACK_SYNC) that will be synchronized from the linked repository.
    ///   - roleArn: The ARN of the IAM role that grants permission for Amazon Web Services to use Git sync to update a given Amazon Web Services resource on your behalf.
    ///   - syncType: The type of sync configuration.
    ///   - triggerResourceUpdateOn: When to trigger Git sync to begin the stack update.
    ///   - logger: Logger use during operation
    @inlinable
    public func createSyncConfiguration(
        branch: String,
        configFile: String,
        publishDeploymentStatus: PublishDeploymentStatus? = nil,
        repositoryLinkId: String,
        resourceName: String,
        roleArn: String,
        syncType: SyncConfigurationType,
        triggerResourceUpdateOn: TriggerResourceUpdateOn? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateSyncConfigurationOutput {
        let input = CreateSyncConfigurationInput(
            branch: branch, 
            configFile: configFile, 
            publishDeploymentStatus: publishDeploymentStatus, 
            repositoryLinkId: repositoryLinkId, 
            resourceName: resourceName, 
            roleArn: roleArn, 
            syncType: syncType, 
            triggerResourceUpdateOn: triggerResourceUpdateOn
        )
        return try await self.createSyncConfiguration(input, logger: logger)
    }

    /// The connection to be deleted.
    @Sendable
    @inlinable
    public func deleteConnection(_ input: DeleteConnectionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteConnectionOutput {
        try await self.client.execute(
            operation: "DeleteConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// The connection to be deleted.
    ///
    /// Parameters:
    ///   - connectionArn: The Amazon Resource Name (ARN) of the connection to be deleted.  The ARN is never reused if the connection is deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConnection(
        connectionArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteConnectionOutput {
        let input = DeleteConnectionInput(
            connectionArn: connectionArn
        )
        return try await self.deleteConnection(input, logger: logger)
    }

    /// The host to be deleted. Before you delete a host, all connections associated to the host must be deleted.  A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state.
    @Sendable
    @inlinable
    public func deleteHost(_ input: DeleteHostInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteHostOutput {
        try await self.client.execute(
            operation: "DeleteHost", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// The host to be deleted. Before you delete a host, all connections associated to the host must be deleted.  A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state.
    ///
    /// Parameters:
    ///   - hostArn: The Amazon Resource Name (ARN) of the host to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteHost(
        hostArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteHostOutput {
        let input = DeleteHostInput(
            hostArn: hostArn
        )
        return try await self.deleteHost(input, logger: logger)
    }

    /// Deletes the association between your connection and a specified external Git repository.
    @Sendable
    @inlinable
    public func deleteRepositoryLink(_ input: DeleteRepositoryLinkInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteRepositoryLinkOutput {
        try await self.client.execute(
            operation: "DeleteRepositoryLink", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the association between your connection and a specified external Git repository.
    ///
    /// Parameters:
    ///   - repositoryLinkId: The ID of the repository link to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteRepositoryLink(
        repositoryLinkId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteRepositoryLinkOutput {
        let input = DeleteRepositoryLinkInput(
            repositoryLinkId: repositoryLinkId
        )
        return try await self.deleteRepositoryLink(input, logger: logger)
    }

    /// Deletes the sync configuration for a specified repository and connection.
    @Sendable
    @inlinable
    public func deleteSyncConfiguration(_ input: DeleteSyncConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteSyncConfigurationOutput {
        try await self.client.execute(
            operation: "DeleteSyncConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the sync configuration for a specified repository and connection.
    ///
    /// Parameters:
    ///   - resourceName: The name of the Amazon Web Services resource associated with the sync configuration to be deleted.
    ///   - syncType: The type of sync configuration to be deleted.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteSyncConfiguration(
        resourceName: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteSyncConfigurationOutput {
        let input = DeleteSyncConfigurationInput(
            resourceName: resourceName, 
            syncType: syncType
        )
        return try await self.deleteSyncConfiguration(input, logger: logger)
    }

    /// Returns the connection ARN and details such as status, owner, and provider type.
    @Sendable
    @inlinable
    public func getConnection(_ input: GetConnectionInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetConnectionOutput {
        try await self.client.execute(
            operation: "GetConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the connection ARN and details such as status, owner, and provider type.
    ///
    /// Parameters:
    ///   - connectionArn: The Amazon Resource Name (ARN) of a connection.
    ///   - logger: Logger use during operation
    @inlinable
    public func getConnection(
        connectionArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetConnectionOutput {
        let input = GetConnectionInput(
            connectionArn: connectionArn
        )
        return try await self.getConnection(input, logger: logger)
    }

    /// Returns the host ARN and details such as status, provider type, endpoint, and, if applicable, the VPC configuration.
    @Sendable
    @inlinable
    public func getHost(_ input: GetHostInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetHostOutput {
        try await self.client.execute(
            operation: "GetHost", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the host ARN and details such as status, provider type, endpoint, and, if applicable, the VPC configuration.
    ///
    /// Parameters:
    ///   - hostArn: The Amazon Resource Name (ARN) of the requested host.
    ///   - logger: Logger use during operation
    @inlinable
    public func getHost(
        hostArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetHostOutput {
        let input = GetHostInput(
            hostArn: hostArn
        )
        return try await self.getHost(input, logger: logger)
    }

    /// Returns details about a repository link. A repository link allows Git sync to monitor and sync changes from files in a specified Git repository.
    @Sendable
    @inlinable
    public func getRepositoryLink(_ input: GetRepositoryLinkInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRepositoryLinkOutput {
        try await self.client.execute(
            operation: "GetRepositoryLink", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns details about a repository link. A repository link allows Git sync to monitor and sync changes from files in a specified Git repository.
    ///
    /// Parameters:
    ///   - repositoryLinkId: The ID of the repository link to get.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRepositoryLink(
        repositoryLinkId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRepositoryLinkOutput {
        let input = GetRepositoryLinkInput(
            repositoryLinkId: repositoryLinkId
        )
        return try await self.getRepositoryLink(input, logger: logger)
    }

    /// Returns details about the sync status for a repository. A repository sync uses Git sync to push and pull changes from your remote repository.
    @Sendable
    @inlinable
    public func getRepositorySyncStatus(_ input: GetRepositorySyncStatusInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetRepositorySyncStatusOutput {
        try await self.client.execute(
            operation: "GetRepositorySyncStatus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns details about the sync status for a repository. A repository sync uses Git sync to push and pull changes from your remote repository.
    ///
    /// Parameters:
    ///   - branch: The branch of the repository link for the requested repository sync status.
    ///   - repositoryLinkId: The repository link ID for the requested repository sync status.
    ///   - syncType: The sync type of the requested sync status.
    ///   - logger: Logger use during operation
    @inlinable
    public func getRepositorySyncStatus(
        branch: String,
        repositoryLinkId: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetRepositorySyncStatusOutput {
        let input = GetRepositorySyncStatusInput(
            branch: branch, 
            repositoryLinkId: repositoryLinkId, 
            syncType: syncType
        )
        return try await self.getRepositorySyncStatus(input, logger: logger)
    }

    /// Returns the status of the sync with the Git repository for a specific Amazon Web Services resource.
    @Sendable
    @inlinable
    public func getResourceSyncStatus(_ input: GetResourceSyncStatusInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetResourceSyncStatusOutput {
        try await self.client.execute(
            operation: "GetResourceSyncStatus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the status of the sync with the Git repository for a specific Amazon Web Services resource.
    ///
    /// Parameters:
    ///   - resourceName: The name of the Amazon Web Services resource for the sync status with the Git repository.
    ///   - syncType: The sync type for the sync status with the Git repository.
    ///   - logger: Logger use during operation
    @inlinable
    public func getResourceSyncStatus(
        resourceName: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetResourceSyncStatusOutput {
        let input = GetResourceSyncStatusInput(
            resourceName: resourceName, 
            syncType: syncType
        )
        return try await self.getResourceSyncStatus(input, logger: logger)
    }

    /// Returns a list of the most recent sync blockers.
    @Sendable
    @inlinable
    public func getSyncBlockerSummary(_ input: GetSyncBlockerSummaryInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSyncBlockerSummaryOutput {
        try await self.client.execute(
            operation: "GetSyncBlockerSummary", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of the most recent sync blockers.
    ///
    /// Parameters:
    ///   - resourceName: The name of the Amazon Web Services resource currently blocked from automatically being synced from a Git repository.
    ///   - syncType: The sync type for the sync blocker summary.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSyncBlockerSummary(
        resourceName: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSyncBlockerSummaryOutput {
        let input = GetSyncBlockerSummaryInput(
            resourceName: resourceName, 
            syncType: syncType
        )
        return try await self.getSyncBlockerSummary(input, logger: logger)
    }

    /// Returns details about a sync configuration, including the sync type and resource name. A sync configuration allows the configuration to sync (push and pull) changes from the remote repository for a specified branch in a Git repository.
    @Sendable
    @inlinable
    public func getSyncConfiguration(_ input: GetSyncConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> GetSyncConfigurationOutput {
        try await self.client.execute(
            operation: "GetSyncConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns details about a sync configuration, including the sync type and resource name. A sync configuration allows the configuration to sync (push and pull) changes from the remote repository for a specified branch in a Git repository.
    ///
    /// Parameters:
    ///   - resourceName: The name of the Amazon Web Services resource for the sync configuration for which you want to retrieve information.
    ///   - syncType: The sync type for the sync configuration for which you want to retrieve information.
    ///   - logger: Logger use during operation
    @inlinable
    public func getSyncConfiguration(
        resourceName: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetSyncConfigurationOutput {
        let input = GetSyncConfigurationInput(
            resourceName: resourceName, 
            syncType: syncType
        )
        return try await self.getSyncConfiguration(input, logger: logger)
    }

    /// Lists the connections associated with your account.
    @Sendable
    @inlinable
    public func listConnections(_ input: ListConnectionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListConnectionsOutput {
        try await self.client.execute(
            operation: "ListConnections", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the connections associated with your account.
    ///
    /// Parameters:
    ///   - hostArnFilter: Filters the list of connections to those associated with a specified host.
    ///   - maxResults: The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token that was returned from the previous ListConnections call, which can be used to return the next set of connections in the list.
    ///   - providerTypeFilter: Filters the list of connections to those associated with a specified provider, such as Bitbucket.
    ///   - logger: Logger use during operation
    @inlinable
    public func listConnections(
        hostArnFilter: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        providerTypeFilter: ProviderType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListConnectionsOutput {
        let input = ListConnectionsInput(
            hostArnFilter: hostArnFilter, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            providerTypeFilter: providerTypeFilter
        )
        return try await self.listConnections(input, logger: logger)
    }

    /// Lists the hosts associated with your account.
    @Sendable
    @inlinable
    public func listHosts(_ input: ListHostsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHostsOutput {
        try await self.client.execute(
            operation: "ListHosts", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the hosts associated with your account.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - nextToken: The token that was returned from the previous ListHosts call, which can be used to return the next set of hosts in the list.
    ///   - logger: Logger use during operation
    @inlinable
    public func listHosts(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHostsOutput {
        let input = ListHostsInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listHosts(input, logger: logger)
    }

    /// Lists the repository links created for connections in your account.
    @Sendable
    @inlinable
    public func listRepositoryLinks(_ input: ListRepositoryLinksInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRepositoryLinksOutput {
        try await self.client.execute(
            operation: "ListRepositoryLinks", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the repository links created for connections in your account.
    ///
    /// Parameters:
    ///   - maxResults: A non-zero, non-negative integer used to limit the number of returned results.
    ///   - nextToken: An enumeration token that, when provided in a request, returns the next batch of the results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRepositoryLinks(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRepositoryLinksOutput {
        let input = ListRepositoryLinksInput(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listRepositoryLinks(input, logger: logger)
    }

    /// Lists the repository sync definitions for repository links in your account.
    @Sendable
    @inlinable
    public func listRepositorySyncDefinitions(_ input: ListRepositorySyncDefinitionsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRepositorySyncDefinitionsOutput {
        try await self.client.execute(
            operation: "ListRepositorySyncDefinitions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the repository sync definitions for repository links in your account.
    ///
    /// Parameters:
    ///   - repositoryLinkId: The ID of the repository link for the sync definition for which you want to retrieve information.
    ///   - syncType: The sync type of the repository link for the the sync definition for which you want to retrieve information.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRepositorySyncDefinitions(
        repositoryLinkId: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRepositorySyncDefinitionsOutput {
        let input = ListRepositorySyncDefinitionsInput(
            repositoryLinkId: repositoryLinkId, 
            syncType: syncType
        )
        return try await self.listRepositorySyncDefinitions(input, logger: logger)
    }

    /// Returns a list of sync configurations for a specified repository.
    @Sendable
    @inlinable
    public func listSyncConfigurations(_ input: ListSyncConfigurationsInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListSyncConfigurationsOutput {
        try await self.client.execute(
            operation: "ListSyncConfigurations", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a list of sync configurations for a specified repository.
    ///
    /// Parameters:
    ///   - maxResults: A non-zero, non-negative integer used to limit the number of returned results.
    ///   - nextToken: An enumeration token that allows the operation to batch the results of the operation.
    ///   - repositoryLinkId: The ID of the repository link for the requested list of sync configurations.
    ///   - syncType: The sync type for the requested list of sync configurations.
    ///   - logger: Logger use during operation
    @inlinable
    public func listSyncConfigurations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        repositoryLinkId: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListSyncConfigurationsOutput {
        let input = ListSyncConfigurationsInput(
            maxResults: maxResults, 
            nextToken: nextToken, 
            repositoryLinkId: repositoryLinkId, 
            syncType: syncType
        )
        return try await self.listSyncConfigurations(input, logger: logger)
    }

    /// Gets the set of key-value pairs (metadata) that are used to manage the resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the set of key-value pairs (metadata) that are used to manage the resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource for which you want to get information about tags, if any.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.
    ///   - tags: The tags you want to modify or add to the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from an Amazon Web Services resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from an Amazon Web Services resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource to remove tags from.
    ///   - tagKeys: The list of keys for the tags to be removed from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates a specified host with the provided configurations.
    @Sendable
    @inlinable
    public func updateHost(_ input: UpdateHostInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateHostOutput {
        try await self.client.execute(
            operation: "UpdateHost", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates a specified host with the provided configurations.
    ///
    /// Parameters:
    ///   - hostArn: The Amazon Resource Name (ARN) of the host to be updated.
    ///   - providerEndpoint: The URL or endpoint of the host to be updated.
    ///   - vpcConfiguration: The VPC configuration of the host to be updated. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateHost(
        hostArn: String,
        providerEndpoint: String? = nil,
        vpcConfiguration: VpcConfiguration? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateHostOutput {
        let input = UpdateHostInput(
            hostArn: hostArn, 
            providerEndpoint: providerEndpoint, 
            vpcConfiguration: vpcConfiguration
        )
        return try await self.updateHost(input, logger: logger)
    }

    /// Updates the association between your connection and a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.
    @Sendable
    @inlinable
    public func updateRepositoryLink(_ input: UpdateRepositoryLinkInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateRepositoryLinkOutput {
        try await self.client.execute(
            operation: "UpdateRepositoryLink", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the association between your connection and a specified external Git repository. A repository link allows Git sync to monitor and sync changes to files in a specified Git repository.
    ///
    /// Parameters:
    ///   - connectionArn: The Amazon Resource Name (ARN) of the connection for the repository link to be updated. The updated connection ARN must have the same providerType (such as GitHub) as the original connection ARN for the repo link.
    ///   - encryptionKeyArn: The Amazon Resource Name (ARN) of the encryption key for the repository link to be updated.
    ///   - repositoryLinkId: The ID of the repository link to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateRepositoryLink(
        connectionArn: String? = nil,
        encryptionKeyArn: String? = nil,
        repositoryLinkId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateRepositoryLinkOutput {
        let input = UpdateRepositoryLinkInput(
            connectionArn: connectionArn, 
            encryptionKeyArn: encryptionKeyArn, 
            repositoryLinkId: repositoryLinkId
        )
        return try await self.updateRepositoryLink(input, logger: logger)
    }

    /// Allows you to update the status of a sync blocker, resolving the blocker and allowing syncing to continue.
    @Sendable
    @inlinable
    public func updateSyncBlocker(_ input: UpdateSyncBlockerInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateSyncBlockerOutput {
        try await self.client.execute(
            operation: "UpdateSyncBlocker", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Allows you to update the status of a sync blocker, resolving the blocker and allowing syncing to continue.
    ///
    /// Parameters:
    ///   - id: The ID of the sync blocker to be updated.
    ///   - resolvedReason: The reason for resolving the sync blocker.
    ///   - resourceName: The name of the resource for the sync blocker to be updated.
    ///   - syncType: The sync type of the sync blocker to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateSyncBlocker(
        id: String,
        resolvedReason: String,
        resourceName: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateSyncBlockerOutput {
        let input = UpdateSyncBlockerInput(
            id: id, 
            resolvedReason: resolvedReason, 
            resourceName: resourceName, 
            syncType: syncType
        )
        return try await self.updateSyncBlocker(input, logger: logger)
    }

    /// Updates the sync configuration for your connection and a specified external Git repository.
    @Sendable
    @inlinable
    public func updateSyncConfiguration(_ input: UpdateSyncConfigurationInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateSyncConfigurationOutput {
        try await self.client.execute(
            operation: "UpdateSyncConfiguration", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the sync configuration for your connection and a specified external Git repository.
    ///
    /// Parameters:
    ///   - branch: The branch for the sync configuration to be updated.
    ///   - configFile: The configuration file for the sync configuration to be updated.
    ///   - publishDeploymentStatus: Whether to enable or disable publishing of deployment status to source providers.
    ///   - repositoryLinkId: The ID of the repository link for the sync configuration to be updated.
    ///   - resourceName: The name of the Amazon Web Services resource for the sync configuration to be updated.
    ///   - roleArn: The ARN of the IAM role for the sync configuration to be updated.
    ///   - syncType: The sync type for the sync configuration to be updated.
    ///   - triggerResourceUpdateOn: When to trigger Git sync to begin the stack update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateSyncConfiguration(
        branch: String? = nil,
        configFile: String? = nil,
        publishDeploymentStatus: PublishDeploymentStatus? = nil,
        repositoryLinkId: String? = nil,
        resourceName: String,
        roleArn: String? = nil,
        syncType: SyncConfigurationType,
        triggerResourceUpdateOn: TriggerResourceUpdateOn? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateSyncConfigurationOutput {
        let input = UpdateSyncConfigurationInput(
            branch: branch, 
            configFile: configFile, 
            publishDeploymentStatus: publishDeploymentStatus, 
            repositoryLinkId: repositoryLinkId, 
            resourceName: resourceName, 
            roleArn: roleArn, 
            syncType: syncType, 
            triggerResourceUpdateOn: triggerResourceUpdateOn
        )
        return try await self.updateSyncConfiguration(input, logger: logger)
    }
}

extension CodeStarConnections {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: CodeStarConnections, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension CodeStarConnections {
    /// Return PaginatorSequence for operation ``listConnections(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listConnectionsPaginator(
        _ input: ListConnectionsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListConnectionsInput, ListConnectionsOutput> {
        return .init(
            input: input,
            command: self.listConnections,
            inputKey: \ListConnectionsInput.nextToken,
            outputKey: \ListConnectionsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listConnections(_:logger:)``.
    ///
    /// - Parameters:
    ///   - hostArnFilter: Filters the list of connections to those associated with a specified host.
    ///   - maxResults: The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - providerTypeFilter: Filters the list of connections to those associated with a specified provider, such as Bitbucket.
    ///   - logger: Logger used for logging
    @inlinable
    public func listConnectionsPaginator(
        hostArnFilter: String? = nil,
        maxResults: Int? = nil,
        providerTypeFilter: ProviderType? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListConnectionsInput, ListConnectionsOutput> {
        let input = ListConnectionsInput(
            hostArnFilter: hostArnFilter, 
            maxResults: maxResults, 
            providerTypeFilter: providerTypeFilter
        )
        return self.listConnectionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listHosts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listHostsPaginator(
        _ input: ListHostsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListHostsInput, ListHostsOutput> {
        return .init(
            input: input,
            command: self.listHosts,
            inputKey: \ListHostsInput.nextToken,
            outputKey: \ListHostsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listHosts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.
    ///   - logger: Logger used for logging
    @inlinable
    public func listHostsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListHostsInput, ListHostsOutput> {
        let input = ListHostsInput(
            maxResults: maxResults
        )
        return self.listHostsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listRepositoryLinks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listRepositoryLinksPaginator(
        _ input: ListRepositoryLinksInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListRepositoryLinksInput, ListRepositoryLinksOutput> {
        return .init(
            input: input,
            command: self.listRepositoryLinks,
            inputKey: \ListRepositoryLinksInput.nextToken,
            outputKey: \ListRepositoryLinksOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listRepositoryLinks(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: A non-zero, non-negative integer used to limit the number of returned results.
    ///   - logger: Logger used for logging
    @inlinable
    public func listRepositoryLinksPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListRepositoryLinksInput, ListRepositoryLinksOutput> {
        let input = ListRepositoryLinksInput(
            maxResults: maxResults
        )
        return self.listRepositoryLinksPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listSyncConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listSyncConfigurationsPaginator(
        _ input: ListSyncConfigurationsInput,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListSyncConfigurationsInput, ListSyncConfigurationsOutput> {
        return .init(
            input: input,
            command: self.listSyncConfigurations,
            inputKey: \ListSyncConfigurationsInput.nextToken,
            outputKey: \ListSyncConfigurationsOutput.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listSyncConfigurations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: A non-zero, non-negative integer used to limit the number of returned results.
    ///   - repositoryLinkId: The ID of the repository link for the requested list of sync configurations.
    ///   - syncType: The sync type for the requested list of sync configurations.
    ///   - logger: Logger used for logging
    @inlinable
    public func listSyncConfigurationsPaginator(
        maxResults: Int? = nil,
        repositoryLinkId: String,
        syncType: SyncConfigurationType,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListSyncConfigurationsInput, ListSyncConfigurationsOutput> {
        let input = ListSyncConfigurationsInput(
            maxResults: maxResults, 
            repositoryLinkId: repositoryLinkId, 
            syncType: syncType
        )
        return self.listSyncConfigurationsPaginator(input, logger: logger)
    }
}

extension CodeStarConnections.ListConnectionsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeStarConnections.ListConnectionsInput {
        return .init(
            hostArnFilter: self.hostArnFilter,
            maxResults: self.maxResults,
            nextToken: token,
            providerTypeFilter: self.providerTypeFilter
        )
    }
}

extension CodeStarConnections.ListHostsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeStarConnections.ListHostsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension CodeStarConnections.ListRepositoryLinksInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeStarConnections.ListRepositoryLinksInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension CodeStarConnections.ListSyncConfigurationsInput: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> CodeStarConnections.ListSyncConfigurationsInput {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            repositoryLinkId: self.repositoryLinkId,
            syncType: self.syncType
        )
    }
}
